//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <ddk.h>

//
// Device Drivers
//
EXTERN IDeviceDriver * CDECL CreatePS2Keyboard(uint_t uDeviceNo, void *pvParameter);
EXTERN IDeviceDriver * CDECL CreateConsole(uint_t uDeviceNo, void *pvParameter);
EXTERN IDeviceDriver * CDECL InitIt8172irq(uint_t uDeviceNo, void *pvParameter);
EXTERN IDeviceDriver * CDECL CreateBootModules(uint_t uDeviceNo, void *pv);
EXTERN IDeviceDriver * CDECL CreateRtl4Usnet(uint_t uDeviceNo, void *pvParameter);
EXTERN IDeviceDriver * CDECL CreateMouse(uint_t uDeviceNo, void *pvParameter);

//Keyboard
#define DEVICENAME_KEYBOARD             L"keyboard"

// Console
#define DEVICENAME_CONSOLE              L"console"

// Mouse
#define DEVICENAME_MOUSE                L"mouse"

// Ite8172
#define DEVICENAME_ITE8172              L"ite8172"

// Boot file list driver
#define DEVICENAME_BOOTMODS             L"bootmods"

// ethercard 8139
#define DEVICENAME_RTL4USNET            L"rtl4usnet"

// IDE Controller
#define DEVICENAME_IDECONTROLLER        L"idecontroller"

EXTERN IDeviceDriver * CDECL CreateIDEController(uint_t uDeviceNo,
                void *pvParameter);

// IDE Drive
#define DEVICENAME_IDEDRIVE             L"idedrive"

EXTERN IDeviceDriver * CDECL CreateIDEDrive(uint_t uDeviceNo, void *pvParameter);

// IDE Partition
#define DEVICENAME_IDEPARTITION         L"idepartition"

EXTERN IDeviceDriver * CDECL CreateIDEPartition(uint_t uDeviceNo, void *pvParameter);

//
// Device Configurations
//

// NOTE: the device name can't be more than 31 words
STATIC DECL_DATAINIT DeviceConfig s_deviceConfigs[] = {
    { DEVICENAME_ITE8172,           0, NULL},
    { DEVICENAME_KEYBOARD,          0, NULL},
    { DEVICENAME_CONSOLE,           0, NULL},
    { DEVICENAME_MOUSE, DEVICENO_NONE, NULL},
    { DEVICENAME_BOOTMODS,          0, NULL },
    { DEVICENAME_RTL4USNET,         0, NULL },
    { DEVICENAME_IDECONTROLLER,     0, NULL },
};

//
// Driver Configurations
//
STATIC DriverConfig s_driverConfigs[] = {
    { DEVICENAME_ITE8172,           &InitIt8172irq },
    { DEVICENAME_KEYBOARD,           &CreatePS2Keyboard },
    { DEVICENAME_CONSOLE,           &CreateConsole },
    { DEVICENAME_MOUSE,             &CreateMouse },
    { DEVICENAME_BOOTMODS,          &CreateBootModules },
    { DEVICENAME_RTL4USNET,         &CreateRtl4Usnet },
    { DEVICENAME_IDECONTROLLER,     &CreateIDEController },
    { DEVICENAME_IDEDRIVE,          &CreateIDEDrive },
    { DEVICENAME_IDEPARTITION,      &CreateIDEPartition },
};

DzConfig dzcfg = {
    s_deviceConfigs,                // *pDeviceConfigs
    lengthof(s_deviceConfigs),      // uNumberOfDeviceConfigs

    s_driverConfigs,                // *pDriverConfigs
    lengthof(s_driverConfigs)       // uNumberOfDriverConfigs
};
